package com.sg.controller.bff;

import com.sg.service.biz.bff.SecurityService;
import com.sg.dto.biz.bff.req.*;
import com.sg.dto.biz.bff.res.*;
import com.sg.common.ro.OkrResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：
 * @version 1.0
 * @date ：
 */
@Api(value = "Security", tags = {"Security"})
@RestController
// @RequestMapping("/oms/security/")
public class SecurityController {

    @Autowired
    SecurityService securityService;

    /**
     * B3新增通用租户规划证书及异常(公共)
     * gen by moon at 5/12/2023, 3:05:00 AM
     */
    @PostMapping("/oms/security/addStandardDetermineTenantCertificateAvailabilityAbnormalCom")
    @ApiOperation(value = "B3新增通用租户规划证书及异常(公共)", response = OkrResult.class)
    public OkrResult<BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComRespDto> addStandardDetermineTenantCertificateAvailabilityAbnormalCom(@RequestBody(required = false) @Validated BffAddStandardDetermineTenantCertificateAvailabilityAbnormalComReqDto reqDTO) {
        return OkrResult.success(securityService.addStandardDetermineTenantCertificateAvailabilityAbnormalCom(reqDTO));
    }

    /**
     * B3判断租户规划钥匙可用(管理)
     * gen by moon at 5/12/2023, 3:15:11 AM
     */
    @PostMapping("/oms/mgt/security/judgeDetermineTenantKeyAvailability")
    @ApiOperation(value = "B3判断租户规划钥匙可用(管理)", response = OkrResult.class)
    public OkrResult<BffJudgeDetermineTenantKeyAvailabilityRespDto> judgeDetermineTenantKeyAvailability(@RequestBody(required = false) @Validated BffJudgeDetermineTenantKeyAvailabilityReqDto reqDTO) {
        return OkrResult.success(securityService.judgeDetermineTenantKeyAvailability(reqDTO));
    }
}
